import requests

# 请求4要素
url = "http://www.baidu.com"
method = 'get'
# headers = {}
# data = {}

# 发送请求， 获得响应
response = requests.request(method=method, url=url, headers=None, data=None)
# 响应的状态码
print(response.status_code)
# 响应的头
print(response.headers)
# 响应的体
print(response.text)

dict1 = {'code': response.status_code, 'headers': response.headers}

print(dict1)


